<!DOCTYPE html>

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>
<div id="imgDiv">
    <img src="001.jpg" style="width: 150px; height: 170px;"> <img
        src="002.jpg" style="width: 150px; height: 170px;"> <img
        src="003.jpg" style="width: 150px; height: 170px;"> <img
        src="004.jpg" style="width: 150px; height: 170px;"> <img
        src="005.jpg" style="width: 150px; height: 170px;">
</div>
<script type="text/javascript">
    var imgDiv = document.getElementById("imgDiv");
    imgDiv.onclick = showMsg;
    function getEventTarget(e) {
        var target = e ? e.target : (window.event ? window.event.srcElement
                : null);
        if (!target) {
            return null;
        }
        while (target.nodeType != 1
        && target.nodeName.toLowerCase() != "body") {
            target = target.parentNode;
        }
        return target;
    }
    function showMsg(e){
        var target = getEventTarget(e);
        if (target.tagName.toLowerCase() == 'img') {
            alert(target.src);
        }
    }

</script>
</body>
</html>